﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SimpleAudioVisual : EffectBase {

    ParticleSystem ParticleSystem;
    public Gradient gradientColor;
    Vector3 beginLocalScale;

    void Start () {
        ParticleSystem = GetComponentInChildren<ParticleSystem>();
        beginLocalScale = transform.localScale;
    }

    public override void OnUpdateAmp(float amp)
    {
        base.OnUpdateAmp(amp);
        transform.localScale = beginLocalScale * (1 + amp * 0.35f);
        ParticleSystem.MainModule main = ParticleSystem.main;
        main.startColor = gradientColor.Evaluate(amp / 1.2f);
    }

}
